@model ConsentViewModel
@{
    ViewData["Title"] = "授权许可";
}

<div style="margin-bottom:15px">
    <div class="row justify-content-md-center">
        <div class="col-sm-8 lead">
            @if (Model.ClientLogoUrl != null)
            {
                <div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
            }
            <h1>
                @Model.ClientName
                <small class="text-muted">需要你的授权</small>
            </h1>
            <p>反选取消授权。</p>
        </div>

        <div class="row justify-content-md-center">
            <div class="col-sm-8">
                <partial name="_ValidationSummary" />
            </div>
        </div>
    </div>
    <form asp-action="Index">
        <input type="hidden" asp-for="ReturnUrl" />
        <div class="row justify-content-md-center">
            <div class="col-sm-8">
                @if (Model.IdentityScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <header class="card-header">
                                <strong>个人信息</strong>
                            </header>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.IdentityScopes)
                                {
                                    <partial name="_ScopeListItem" model="@scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                @if (Model.ApiScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <div class="card-header">
                                <strong>应用授权</strong>
                            </div>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.ApiScopes)
                                {
                                    <partial name="_ScopeListItem" model="scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                <div class="form-group">
                    <div class="card">
                        <div class="card-header">
                            <strong>描述</strong>
                        </div>
                        <div class="card-body">
                            <input class="form-control" placeholder="为这个设备命名或添加描述" asp-for="Description" autofocus>
                        </div>
                    </div>
                </div>

                @if (Model.AllowRememberConsent)
                {
                    <div class="form-group">
                        <div class="form-check">
                            <input class="form-check-input" asp-for="RememberConsent">
                            <label class="form-check-label" asp-for="RememberConsent">
                                <strong>记住我的选择</strong>
                            </label>
                        </div>
                    </div>
                }
            </div>
        </div>

        <div class="row  justify-content-md-center">
            <div class="col-sm-8">
                <button name="button" value="yes" class="btn btn-primary" autofocus style="width:80px;">同意</button>
                <button name="button" value="no" class="btn btn-secondary" style="width:80px;">不同意</button>
                @if (Model.ClientUrl != null)
                {
                    <a class="btn btn-outline-info" href="@Model.ClientUrl" style="float:right">
                        <span class="glyphicon glyphicon-info-sign"></span>
                        <strong>@Model.ClientName</strong>
                    </a>
                }
            </div>
        </div>
    </form>
</div>
